package demo.java.b_cases;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
 * 仿写c:if标签
 * */
public class Demo01_if extends SimpleTagSupport{
	
	private boolean test;
	
	public void setTest(boolean test) {
		this.test = test;
	}

	@Override
	public void doTag() throws JspException, IOException {
		if(test){
			//如果条件成立，则输出标签体内容
			this.getJspBody().invoke(null);
		}
		
	}
}
